import React, { lazy } from 'react'

const Layout = lazy(() => import('../Layout'))

const  Order = lazy(() => import("../pages/Order"));
const  Home = lazy(() => import("../pages/Home"));
const  Shop = lazy(() => import("../pages/Shop"));

const Detail = lazy(() => import('../pages/Detail'))


export const menu = [
    {
        path: '/main/home',
        element: <Home/>,
        name: '首页'
    },
    {
        path: '/main/shop',
        element: <Shop/>,
        name: '商品管理'
    },
    {
        path: '/main/order',
        element: <Order/>,
        name: '订单管理'
    }
]

const routes = [
    {
        path: '/main',
        element: <Layout/>,
        children: menu
    },
    {
        from: '/',
        to: '/main/order'
    },
    {
        path: '/detail/:id',
        element: <Detail/>
    }
]

export default routes